﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;

namespace WebApplication1
{
    public partial class ForgetPassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void bntSubmit_Click(object sender, EventArgs e)
        {
            // cehck if the email ddress existing.
            try
            {
                UserManagement um = new UserManagement();
                um.ForgetPassword(txtEmail.Text);
                txtEmail.Text = "";
                divMessage.Visible = true;
                divMessage.CssClass = "alert alert-success  alert-dismissible";
                lblMessage.Text = "Thank you for using our site. Please check your email account for new issued password!";
            }
            catch (Exception ex)
            {

                divMessage.Visible = true;
                divMessage.CssClass = "alert alert-danger  alert-dismissible";
                lblMessage.Text = ex.Message;
            }
            
        }
    }
}